package com.ruoyi.business.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.domain.Banner;
import com.ruoyi.business.mapper.BannerMapper;
import com.ruoyi.business.service.IBannerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class BannerServiceImpl extends ServiceImpl<BannerMapper, Banner> implements IBannerService {

    @Resource
    private BannerMapper bannerMapper;

    /**
     * 查询所有banner列表
     *
     * @return banner集合
     */
    @Override
    public List<Banner> getAllBannerList() {
        return bannerMapper.selectAllBannerList();
    }

    /**
     * 查询banner列表
     *
     * @param banner banner
     * @return banner集合
     */
    @Override
    public List<Banner> getBannerList(Banner banner) {
        return bannerMapper.selectBannerList(banner);
    }

    /**
     * 新增banner数据
     *
     * @param banner banner
     */
    @Override
    public int insertBanner(Banner banner) {
        return bannerMapper.insertBanner(banner);
    }

    /**
     * 更新banner数据
     *
     * @param banner banner
     */
    @Override
    public int updateBanner(Banner banner) {
        return bannerMapper.updateBanner(banner);
    }

    @Override
    public Banner getBannerById(long id) {
        return bannerMapper.selectById(id);
    }
}
